import request from '@/utils/request'

export function getClassType(params) {
    return request({
        url: 'course/course-type/tree',
        method: 'get',
        params
    })
}

export function pageCourseList(params) {
    return request({
        url: 'course/page-course-list',
        method: 'get',
        params
    })
}

//首页获取推荐或者热门课程
export function pageCourseListPc(params) {
    return request({
        url: 'course/page-course-list-pc',
        method: 'get',
        params
    })
}

export function getCourseInfo(id) {
    return request({
        url: 'course/getCourseInfo/'+id,
        method: 'get',
    })
}
//课程评价
export function courseGradeCreate(data) {
    return request({
        url: 'course-grade/create',
        method: 'post',
        data
    })
}
//查询课程评价
export function pageCourseGradeList(params) {
    return request({
        url: 'course-grade/page-list-pc',
        method: 'get',
        params
    })
}

//记笔记
export function addNote(data) {
    return request({
        url: 'web/note/create',
        method: 'post',
        data
    })
}

//问题回复
export function answerQue(data) {
    return request({
        url: 'web/answer/create',
        method: 'post',
        data
    })
}

//查询当前课程个人当前学习到哪里
export function personStudyInfo(params) {
    return request({
        url: 'course/study-record-details/personInfo',
        method: 'get',
        params
    })
}

//保存当前课程个人当前学习进度，视频定位
export function savePersonStudyInfo(data) {
    return request({
        url: 'course/study-record-details/create',
        method: 'post',
        data
    })
}

//消防培训保存当前课程个人当前学习章节
export function savePersonStudyInfoXf(data) {
    return request({
        url: 'course/study-record-details/createXf',
        method: 'post',
        data
    })
}

//pc、app移动端查询课程播放资源
export function getCourseResource(id) {
    return request({
        url: 'course-recource/findOne/'+id,
        method: 'get',
    })
}
//首页查询轮播图
export function bannerList(params) {
    return request({
        url: 'web/banner/page-list-pc',
        method: 'get',
        params
    })
}

//查询个人课程学习总体进度百分比
export function personCourseStudyPercent(params) {
    return request({
        url: 'course/study-record-details/study-percent',
        method: 'get',
        params
    })
}